fun main(args : Array<String>){
    println("https://gitee.com/yiyizhang123/kotlin")
    var parent = Parent()
    parent.printNum()

}
//Any toString() hashCode() equals()

open class Base(p:Int){

    open val num:Int = 9

    open fun eat(){
        println("Base eat")
    }


}
interface Inter{
    fun eat(){
        println("Inter eat")
    }
}
class Parent:Base(9),Inter{

    override var num:Int = 5

    //var 可以重写val   反过来不可以

    fun printNum(){
        println("num=$num")
    }

    override fun eat(){
        super<Base>.eat()
        super<Inter>.eat()
        println("Parent eat")
    }


}



